Using "==" or "!=" to compare strings only works if intern version is used on both sides.

<p>
  This rule is deprecated, use {rule:java:StringEqualityComparisonCheck} or {rule:java:S1698} instead.
</p>
